import request from '@/utils/request';

const userApi = {
    queryWithDrawOrder: '/web/query/withdraw/order/form', // 查询提现审核订单
    downloadWithDrawOrder: '/web/query/withdraw/order/form', // 导出提现审核订单
    auditWithDrawOrder: '/web/check/withdraw/order/form', // 审核提现订单
    queryTransactionOrder: '/web/query/order/form', // 查询交易订单
    downloadTransactionOrder: '/web/query/order/form', // 导出交易订单
    queryTransactionType: '/web/query/order/type/enums', // 查询交易类型
    queryFarmerPostRecord: '/web/query/farmer/product/post/record', // 查询农场产品邮寄记录
    updateFarmerPostRecord: '/web/update/farmer/product/post/record', // 修改产品邮寄记录为已邮寄
    queryOrderFormDailyStat: '/web/query/order/form/daily/stat', // 查询渠道订单统计金额
    queryAwardRecord: '/web/query/award/record', // 查询奖励记录
    printGoodsOrderByManual: '/web/print/goods/order/by/manual', // 手动打印商品订单
}

// 查询已提交的提现订单
export function queryWithDrawOrder (parameter) {
    return request({
        url: userApi.queryWithDrawOrder,
        method: 'post',
        headers: {
            'name':'queryWithDrawOrder',
        },
        data: parameter
    })
}
// 导出提现订单
export function downloadWithDrawOrder (parameter) {
    return request({
        url: userApi.downloadWithDrawOrder,
        method: 'post',
        responseType: "arraybuffer",
        headers: {
            'name':'queryWithDrawOrder',
        },
        data: parameter
    })
}

// 审核提交的提现订单
export function auditWithDrawOrder(parameter){
    return request({
        url: userApi.auditWithDrawOrder,
        method: 'post',
        headers: {
            'name':'auditWithDrawOrder',
        },
        data: parameter
    })
}

// 查询交易订单
export function queryTransactionOrder(parameter){
    return request({
        url: userApi.queryTransactionOrder,
        method: 'post',
        headers: {
            'name':'queryTransactionOrder',
        },
        data: parameter
    })
}
// 导出交易订单
export function downloadTransactionOrder(parameter){
    return request({
        url: userApi.downloadTransactionOrder,
        method: 'post',
        responseType: "arraybuffer",
        headers: {
            'name':'queryTransactionOrder',
        },
        data: parameter
    })
}

// 查询交易类型
export function queryTransactionType(parameter){
    return request({
        url: userApi.queryTransactionType,
        method: 'post',
        headers: {
            'name':'queryTransactionType',
        },
        data: parameter
    })
}

// 查询产品邮寄记录
export function queryFarmerPostRecord(parameter){
    return request({
        url: userApi.queryFarmerPostRecord,
        method: 'post',
        headers: {
            'name':'queryFarmerPostRecord',
        },
        data: parameter
    })
}
// 修改产品邮寄记录为已邮寄
export function updateFarmerPostRecord(parameter){
    return request({
        url: userApi.updateFarmerPostRecord,
        method: 'post',
        headers: {
            'name':'updateFarmerPostRecord',
        },
        data: parameter
    })
}

// 查询渠道订单统计金额
export function queryOrderFormDailyStat(parameter){
    return request({
        url: userApi.queryOrderFormDailyStat,
        method: 'post',
        headers: {
            'name':'queryOrderFormDailyStat',
        },
        data: parameter
    })
}

// 查询奖励记录
export function queryAwardRecord(parameter){
    return request({
        url: userApi.queryAwardRecord,
        method: 'post',
        headers: {
            'name':'queryAwardRecord',
        },
        data: parameter
    })
}

// 手动打印商品订单
export function printGoodsOrderByManual(parameter){
    return request({
        url: userApi.printGoodsOrderByManual,
        method: 'post',
        headers: {
            'name':'printGoodsOrderByManual',
        },
        data: parameter
    })
}